package b2.config
{
	public class EnemySkillConfig
	{
		public var name:String;
		public var index:int;
		public var movieIndex:int;
		public var bulletSkillIndex:int;
		public var bulletIndex:int;
		public var bulletApPlus:Array;
		public var effectIndex:int;
		public var effectRange:Array;
		public var effectValue:Array;
		public var effectValue2:Array;
		public var effectDuration:Array;
		public var cooldown:int;
		public var areas:Object;
		//技能动画
		public var movies:Object;
		//范围伤害
		public var areaDemage:Array;
		
		public function EnemySkillConfig(skillXML:XML)
		{
			name = skillXML.name;
			index = skillXML.index;
			movieIndex = skillXML.movieIndex;
			bulletSkillIndex = skillXML.bulletSkillIndex;
			bulletIndex = skillXML.bulletIndex;
			if (skillXML.bulletApPlus != undefined)
				bulletApPlus = skillXML.bulletApPlus.split(",");
			else
				bulletApPlus = [0];
			effectIndex = skillXML.effectIndex;
			if (skillXML.effectRange != undefined)
				effectRange = skillXML.effectRange.split(",");
			else
				effectRange = [0];
			if (skillXML.effectValue != undefined)
				effectValue = skillXML.effectValue.split(",");
			else
				effectValue = [0];
			if (skillXML.effectValue2 != undefined)
				effectValue2 = skillXML.effectValue2.split(",");
			else
				effectValue2 = [0];
			if (skillXML.effectDuration != undefined)
				effectDuration = skillXML.effectDuration.split(",");
			else
				effectDuration = [0];
			cooldown = skillXML.cooldown;
			areas = new Array();
			if (skillXML.areaDemage != undefined)
				areaDemage = skillXML.areaDemage.split(",");
			else
				areaDemage = [0];
			for (var i:int = 0; i < skillXML.area.length(); i++)
			{
				var areaConfig:EnemySkillAreaConfig = new EnemySkillAreaConfig(skillXML.area[i]);
				areas[i] = areaConfig;
			}
			movies = new Array();
			for (i = 0; i < skillXML.movie.length(); i++)
			{
				var movieConfig:EnemySkillMovieConfig = new EnemySkillMovieConfig(skillXML.movie[i]);
				movies[i] = movieConfig;
			}
		}
	}
}